﻿/*                              
   Copyright 2011 Nils Kopal, Christopher Krüger, Simone Sauer, Dennis Nolte, Uni Duisburg-Essen

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
*/
using System;
using Sharebert.OverlayLibrary.API;
using Sharebert.LinkLayerLibrary;

namespace Sharebert.OverlayLibrary
{

    public class PeerListReceivedEventArgs : EventArgs
    {
        public PeerListReceivedEventArgs(PeerList list)
        {
            this.List = list;
        }

        public PeerList List { get; set; }
    }

    /// <summary>
    /// Used by the server when a client searches for files.
    /// </summary>
    public class SearchReceivedEventArgs : EventArgs
    {
        public SearchReceivedEventArgs(IConnectionHandler peer, string regEx)
        {
            this.Peer = peer;
            this.RegEx = regEx;
        }

        public IConnectionHandler Peer { get; set; }

        public string RegEx { get; set; }
    }

    /// <summary>
    /// Used by the peer when a search result has been received.
    /// </summary>
    public class SearchResultReceivedEventArgs : EventArgs
    {
        public SearchResultReceivedEventArgs(SearchResult[] results)
        {
            this.ResultList = results;
        }

        public SearchResult[] ResultList { get; set; }
    }

    /// <summary>
    /// Used by the peer when a search request has been received.
    /// </summary>
    public class SearchRequestReceivedEventArgs : EventArgs
    {
        public SearchRequestReceivedEventArgs(string regEx, byte[] hash)
        {
            this.RegEx = regEx;
            this.Hash = hash;
        }

        public string RegEx { get; set; }
        public byte[] Hash { get; set; }
    }
}
